package com.first.nell.data

import com.first.nell.ProjectConfig

data class DataCountryConfig(
    /** 当前审核版本号 */
    val accVersion: Int = ProjectConfig.NARSCASH_Version,
    /** 权限提示 */
    val tips: String = "To access your eligibility and facilitate faster disbursal of your loan, we need permissions to access your Contact, Phone and SMS.",
    /** 权限页请求权限 */
    val permission: List<String>,
    /** 首页请求权限 */
    val home: List<String>,
    /** 权限页审核时请求权限 */
    val permissionGp: List<String>,
    /** 客服电话 */
    val customer: String,
    /** 审核账号 */
    val accM: String,
    /** 审核token */
    val accTk: String,
    /** 是否请求应用统计权限，默认NO */
    val usageStatsPermission: String? = "NO",
    /** 默认拉取应用统计日志天数，默认7天 */
    val usageStatsDays: Int? = 7
) {
    /**
     * 是否审核版本
     * */
    fun isFirstNellAccFirstNellMode(): Boolean {
        return (ProjectConfig.NARSCASH_Version >= accVersion)
    }

    /** 查询权限页待申请的权限列表 */
    fun getFirstNellPermissionsFirstNellOfFirstNellPermissionFirstNellPage(): List<String> {
        if (isFirstNellAccFirstNellMode()) {
            return permissionGp
        }
        return permission
    }

    /** 查询首页待申请的权限列表 */
    fun getFirstNellHomeFirstNellPageFirstNellPermissions(): List<String> {
        val list = mutableListOf<String>()
        list.addAll(permission)
        list.addAll(home)

        return list
    }

    /** 查询是否需要使用应用统计权限数据 */
    fun isFirstNellNeedFirstNellUsageFirstNellStatsFirstNellPermissions(): Boolean {
        usageStatsPermission?.let {
            return it.equals("YES", true)
        }
        return false
    }

    /** 获取需要拉取多少天的应用统计数据 */
    fun getCashArrwoUsageFirstNellStatsFirstNellDays(): Int {
        usageStatsDays?.let { it ->
            return it
        }
        return 7
    }
}